<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta charset="UTF-8" />
<title>Insert title here</title>
</head>
<body>
	<h1>欢迎登录</h1>
	<h1 th:if="${msg != null }" th:text="${msg}" style="color: red"></h1>
	<form action="/login" method="post">
		用户名：<input type="text" name="username" /><br /> 
		密码：<input
			type="password" name="password" /><br /> 
			验证码：<input type="text"
			name="captcha" /><img alt="验证码" th:src="@{/Captcha.jpg}" title="点击更换"
			id="captcha_img" /> (看不清<a href="javascript:void(0)"
			onclick="javascript:refreshCaptcha()">换一张</a>)<br /> <input
			type="checkbox" name="rememberMe" />记住我<br /> <input type="submit"
			value="提交" />
		<button>
			<a href="/unlockAccount">解锁admin用户</a>
		</button>
	</form>
</body>
<script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
<script type="text/javascript">
	function kickout() {
		var href = location.href;
		if (href.indexOf("kickout") > 0) {
			alert("您的账号在另一台设备上登录,如非本人操作，请立即修改密码！");
		}
	}
	window.onload = kickout();

	function refreshCaptcha() {
		alert($("#captcha_img").attr(
				"src"));
		$("#captcha_img").attr(
				"src",
				"/Captcha.jpg?id=" + new Date()
						+ Math.floor(Math.random() * 24));
		alert($("#captcha_img").attr(
		"src"));
	}
</script>
</html>
